package binderon.co.il.domain;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import javax.validation.constraints.NotNull;
import javax.persistence.Column;
import binderon.co.il.domain.UserRole;
import javax.persistence.Enumerated;
import javax.persistence.EnumType;
import binderon.co.il.domain.UserStatus;

@RooJavaBean
@RooToString
@RooEntity(identifierColumn = "id", table = "app_users", finders = { "findAppUsersByOpenIdIdentifier" })
public class AppUser {

    @NotNull
    @Column(name = "name")
    private String name;

    @NotNull
    @Column(name = "password")
    private String password;

    @NotNull
    @Enumerated(EnumType.STRING)
    private UserRole userRole;

    @Column(name = "openid_identifier")
    private String openIdIdentifier;

    @Column(name = "first_name")
    private String firstName;

    @Column(name = "last_name")
    private String lastName;

    @Column(name = "email_address")
    private String emailAddress;

    @NotNull
    @Enumerated(EnumType.STRING)
    private UserStatus status;
}
